#include "favoritesitem.h"
#include <QIcon>

using namespace ExecTerminalImplNS;

const bool I_AM_NOT_FOLDER = false;

FavoritesItem::FavoritesItem(const QString & aName, 
                             const QPixmap & aIcon, 
                             const QString & aUrl, 
                             FolderFavoritesItem * prnt) : AbstractFavoritesItem(aName, prnt),
                             
theIcon(aIcon),
theUrl(aUrl)
{

}

FavoritesItem::FavoritesItem(FolderFavoritesItem * prnt): AbstractFavoritesItem(prnt)
{

}

void FavoritesItem::setIcon(const QPixmap & aicon)
{
    theIcon = aicon;
}

QString FavoritesItem::url()const
{
    return theUrl;
}

void FavoritesItem::setUrl(const QString & aUrl)
{
    theUrl = aUrl;
}

bool FavoritesItem::isFolder()const
{
    return I_AM_NOT_FOLDER;
}

void FavoritesItem::readFromDataStream(QDataStream & ds)
{
    AbstractFavoritesItem::readFromDataStream(ds);
    ds >> theIcon;
    ds >> theUrl;
}

void FavoritesItem::writeToDataStream(QDataStream &ds)const
{
    AbstractFavoritesItem::writeToDataStream(ds);
    ds << theIcon;
    ds << theUrl;
}

QIcon FavoritesItem::provideIcon()const
{
    return theIcon;
}



    
